#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>

#include "sort.h"

int main(int argc, char** argv){
	
	char **words;
	int arraysize=26;
	unsigned int letra=122;
	int i=0;
	
	words=(char**)malloc(arraysize*sizeof(size_t));
	if (words == NULL) {
		return EXIT_FAILURE;
	}

	for (i=0;i<arraysize;i++) {
		words[i]=(char*)malloc(2*sizeof(char));
		words[i][0]=(char)letra;
		words[i][1]='\0';
		letra--;		
	}

	printf("Array antes de ordenar: {");
	for (i=0;i<arraysize-1;i++) {
		printf("%s ",words[i]);
	}
	printf("%s}\n",words[arraysize-1]);

	shellsort(words,arraysize);

	printf("Array luego de ordenar: {");
	for (i=0;i<arraysize-1;i++) {
		printf("%s ",words[i]);
	}
	printf("%s}\n",words[arraysize-1]);

	for (i=0;i<arraysize;i++)
		free(words[i]);
	free(words);

	return EXIT_SUCCESS;
}
